package com.example.ymm.modules1.service.hl.ex;

import com.alibaba.fastjson.JSONObject;
import com.example.ymm.base.BaseService;
import com.example.ymm.model.TableList;
import com.example.ymm.model.YmPageDto;
import com.example.ymm.modules1.entity.hl.ex.ExPublishGroup;
import com.example.ymm.modules1.entity.hl.ex.ExPublishPaper;
import com.example.ymm.modules1.entity.hl.ex.ExUserPaper;
import com.example.ymm.modules1.query.hl.ex.ExPublishPaperQueryCriteria;
import com.example.ymm.modules1.service.dto.heng.ex.GroupOneResultDto;
import com.example.ymm.modules1.service.dto.heng.ex.UserAnserDetailDto;
import com.example.ymm.modules1.service.dto.heng.ex.UserAnserDto;


import java.util.List;

public interface ExPublishPaperService extends BaseService<ExPublishPaper> {


    TableList<ExPublishPaper> list(ExPublishPaperQueryCriteria criteria, YmPageDto ymPage);

    List<ExPublishPaper> queryAll(ExPublishPaperQueryCriteria criteria);


    /**
     * 发布试卷
     * @param exPublishPaper
     */
    void addPublishPaper(ExPublishPaper exPublishPaper);

    /**
     * 删除已发布试卷
     * @param exPublishPaper
     */
    void removePublishPaper(ExPublishPaper exPublishPaper);

    /**
     * 已发布试卷的详情
     */
    ExPublishPaper getPublishPaper(ExPublishPaper exPublishPaper);


    /**
     * 不带试卷信息
     * @param publishPaperId
     * @return
     */
    ExPublishPaper getSamplePaper(String publishPaperId);


    /**
     * 用户加入考试
     * @param userName
     * @param publishPaperId
     */
    ExUserPaper userJoinPaper(String userName, String publishPaperId);

    /**
     * 获取用户答题试卷情况
     */
    ExPublishPaper getUserPaper(String userName,String publishPaperId);


    /**
     * 开始考试
     * 自动切换模块
     */
    void startPublishPaper(ExPublishPaper exPublishPaper);


    /**
     * 系统交卷-内部
     * 用户提交交卷数据
     */
    UserAnserDto sysSubmitPaper(ExPublishPaper exPublishPaper, String userName);

    /**
     * 交卷-外部人员面试
     */

    GroupOneResultDto userSubmitPaper(ExPublishPaper exPublishPaper, String userName);



    /**
     * 手动交卷
     */
    void shoudongTongzhi(String publishPaperId);


    /**
     * 判断是最后一个模块就交卷了
     */
    void upNextGroup(ExPublishPaper exPublishPaper);


    void autoStartGroup(ExPublishGroup nextGroup, Integer limitTime);
    /**
     * 恢复考试到第一个模块
     */
    void recoverPublishPaper(String publishPaperId);


    /**
     * 获取考试分数-详细
     * @param publishPaperId
     * @param userName
     * @return
     */
    UserAnserDetailDto getUserScore(String publishPaperId, String userName);


    /**
     * 定时执行开启任务
     */
    void exScheduledSeconds();

    /**
     * 自动结束 团队考试模块
     */
    void autoCloseTeamGroup();


    /**
     * 自动开始考试
     */
    void autoStartPaper();

}
